import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home";
import Movie from "../views/Movie";
import Theater from "../views/Theater";
import MyCenter from "../views/myCenter";
import Hot from "../views/Hot";
import ComingSoon from "../views/ComingSoon";
import CityList from "../views/CityList";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/home"
  },
  {
    path: "/city-list",
    component: CityList
  },
  // 首页
  {
    path: "/home",
    name: "home",
    redirect: "/home/movie",
    component: Home,
    children: [
      {
        path: "movie",
        component: Movie,
        redirect: "/home/movie/hot",
        children: [
          {
            path: "hot",
            component: Hot
          },
          {
            path: "comingSoon",
            component: ComingSoon
          }
        ]
      },
      {
        path: "theater",
        component: Theater
      },
      {
        path: "myCenter",
        component: MyCenter
      }
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router;
